home *** CD-ROM | disk | FTP | other *** search
- <%
-
- function sendmail(recipient_name, recipient_address, sender_name, sender_address, subject, body)
-
- on error resume next
-
- dim smtpObj
- set smtpObj = Server.CreateObject("aspSmartMail.SmartMail")
-
- ' Mail Server
- ' ***********
- smtpObj.Server = "mail.aspapp.com"
-
- ' From
- ' ****
-
- if sender_name = "" then
-
- smtpObj.SenderName = "ASPapp.com"
- smtpObj.SenderAddress = "webmaster@aspapp.com"
-
- else
-
- smtpObj.SenderName = sender_name
- smtpObj.SenderAddress = sender_address
-
- end if
-
- ' To
- ' **
- smtpObj.Recipients.Add recipient_address, recipient_name
-
- 'Carbon copy
- ' ***********
- 'smtpObj.CCs.Add "yourfriend2@anydomain.com", "Friend2's name"
-
- ' Blind carbon copy
- ' *****************
- 'smtpObj.BCCs.Add "yourfriend3@anydomain.com", "Friend3's name"
-
- ' Reply To
- ' ********
- 'smtpObj.ReplyTos.Add "yourfriend4@anydomain.com", "Friend4's name"
-
- ' Message
- ' *******
- smtpObj.Subject = subject
- smtpObj.Body = body
-
- ' Parameters
- ' **********
- 'smtpObj.DateTime = "Wed, 23 febr 2000 12:00 +0600"
- 'smtpObj.Organization = "your Society Inc."
- 'smtpObj.XMailer = "Your Web Application"
- 'smtpObj.Priority = 1
- 'smtpObj.ReturnReceipt = false
- 'smtpObj.ConfirmRead = true
- 'smtpObj.ContentType = "text/plain"
- 'smtpObj.Charset = "us-ascii"
- 'smtpObj.Encoding = "base64"
-
- ' Attached file
- ' *************
- 'smtpObj.Attachments.Add Server.MapPath("sample.txt"), false
-
- ' Send the message
- ' ****************
- smtpObj.SendMail
-
- if err.number <> 0 then
-
- sendmail = -1
-
- else
-
- sendmail = 1
-
- end if
-
- set smtpObj = nothing
-
- end function
-
- %>